<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<script type="text/javascript">
	function friendLinkDelete(friendLinkId){
		if(confirm("您确定要删除这个友链吗？")){
			window.location="friendLinkManage?action=delete&friendLinkId="+friendLinkId;
		}
	}
</script>
<div class="list-group">
	<div class="list-group-item">
		<img src="${pageContext.request.contextPath}/image/icon/list_icon.png" />
		友链列表 <span class="category_add">
			<button class="btn btn-mini btn-success" type="button"
				onclick="javascript:window.location='friendLinkManage?action=preSave'">添加类别</button>
		</span>
	</div>
	<div>
		<table class="table table-hover table-striped">
			<tr>
				<th>友链标题</th>
				<th>友链地址</th>
				<th>友链操作</th>
			</tr>
			<c:forEach var="friendLink" items="${friendLinks}">
				<tr>
					<td>${friendLink.title }</td>
					<td>${friendLink.url}</td>
					<td><button class="btn btn-mini btn-info" type="button"
							onclick="javascript:window.location='friendLinkManage?action=preSave&friendLinkId=${friendLink.id }'">修改</button>&nbsp;
						<button class="btn btn-mini btn-danger" type="button"
							onclick="friendLinkDelete(${friendLink.id })">删除</button></td>
				</tr>
			</c:forEach>
		</table>
	</div>
	<div align="center">
		<font color="red">${error}</font>
	</div>
</div>
